package info.demo.persistence;

import info.demo.entity.EntidadePersistente;

import java.io.Serializable;
import java.util.List;

import javax.persistence.PersistenceException;

public interface GenericDAO<T extends EntidadePersistente, ID extends Serializable> extends Serializable {

    public T getById(ID id, boolean lock) throws PersistenceException;

    public T getById(ID id) throws PersistenceException;

    public T findById(ID id, boolean lock) throws PersistenceException;

    public T findById(ID id) throws PersistenceException;

    public List<T> findAll() throws PersistenceException;

    public T saveOrUpdate(T entity) throws PersistenceException;

    public T save(T entity) throws PersistenceException;

    public T update(T entity) throws PersistenceException;

    public T delete(T entity) throws PersistenceException;
    
}